package com.wdz.fifter;

import cn.hutool.log.Log;
import cn.hutool.log.LogFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * 配置过滤器
 */
//拦截器添加跨域支持（如果是web.xml配置拦截器，请将@component删除）
@Component
public class MyFifter implements Filter {

    private static final Log log = LogFactory.get();


    /**
     * 在这个方法里面对参数进行一些预处理
     * @param servletRequest
     * @param servletResponse
     * @param filterChain
     * @throws IOException
     * @throws ServletException
     */
    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        //log.info("--------------------进入过滤器--------------------");
        //请求放行
        filterChain.doFilter(servletRequest, servletResponse);
        //log.info("------------------------过滤器结束---------------------");
    }
    @Override
    public void destroy() {
    }
    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
    }
}

